fix: Unwanted white gap between bar border and bar fill (chartjs#12094)#12117
fix: Unwanted white gap between bar border and bar fill (chartjs#12094)#12117minjibak wants to merge 4 commits intochartjs:masterfrom
Conversation
|
Could you also add a test for this? |
… - Added tests in element.bar.tests.js to verify pixel snapping fix
|
Hi, I added tests for the pixel snapping fix in element.bar.tests.js. Verifies that bars with a thick borderWidth do not produce white gaps. Verifies that borderRadius is handled correctly without creating gaps. The original change in element.bar.js remains the same; these tests just ensure the fix is covered automatically. |
test: fix Bar element tests to use options.borderWidth (chartjs#12094)
|
Fixed an issue in the tests where bar.borderWidth was undefined in some environments. Updated the tests to use bar.options.borderWidth instead, ensuring they pass consistently across platforms. This change only affects the test code; the original pixel snapping fix in element.bar.js remains unchanged. |
Apply pixel snapping only when snap option is enabled
|
@LeeLenaleee Hi, just an update regarding the previous commits: The original fix remains unchanged, but I added a snap option to elements.bar. This allows pixel snapping to be applied only when explicitly enabled, which prevents test failures caused by automatic pixel snapping in certain environments. No visual changes occur unless snap: true is set. |
|
For a test I meant something that will break if the implementation gets reversed and the lines become visible again. |
Changes
inflateRectfunction in element.bar.jsRelated issue